package com.ncu.cloundeoffice.mapper;

import com.ncu.cloundeoffice.pojo.TEmployee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
@Mapper
public interface TEmployeeMapper {
    /**
     * 查询所有的人员
     * @param tEmployee
     * @param beginDateScope
     * @return
     */
    List<TEmployee> getAllEmployee(@Param("tEmployee") TEmployee tEmployee, @Param("beginDateScope") Date[] beginDateScope);

    /**
     * 获取工号
     * @return
     */
    String getMaxWorkId();

    /**
     * 添加员工
     * @param tEmployee
     * @return
     */
    int addEmployee(TEmployee tEmployee);

    /**
     * 更新员工
     * @param tEmployee
     * @return
     */
    int updateEmployee(TEmployee tEmployee);

    /**
     * 删除员工
     * @param id
     * @return
     */
    int deleteEmployee(int id);

    /**
     * 查询员工 或者通过id查询
     * @param id
     * @return
     */
    List<TEmployee> getEmployeeById(Integer id);

    /**
     * excel表添加员工
     * @param list
     * @return
     */
    int insertTEmployee(List<TEmployee> list);

    /**
     * 获取所有员工工资账套
     * @return
     */
    List<TEmployee> getEmployeeWithSalary();

    /**
     * 更新员工工资账套
     * @param eid
     * @param sid
     * @return
     */
    int updateEmployeeSalary(@Param("eid") int eid, @Param("sid") int sid);
}
